﻿#ifndef AUDIOOUTPUTTHREAD_H
#define AUDIOOUTPUTTHREAD_H

#include <QObject>
#include <QAudioOutput>
#include <QThread>

class QIODevice;
class QAudioOutput;

class AudioOutputThread: public QObject
{
    Q_OBJECT
public:
    AudioOutputThread(const QAudioFormat &format = QAudioFormat(), QObject *parent = nullptr);
    ~AudioOutputThread();
    void setBuffer(QIODevice *buffer);

public slots:
    void run();
    void stop();
    void pause(bool pause);

private:
    QIODevice *m_buffer;
    QAudioOutput *m_output;
    QAudioFormat m_format;

};

#endif // AUDIOOUTPUTTHREAD_H
